package com.aiti.lulian.controller.promotion;

import cn.hutool.core.util.StrUtil;
import com.aiti.base.core.base.controller.BaseController;
import com.aiti.base.core.base.controller.WebController;
import com.aiti.base.core.utils.message.Message;
import com.aiti.lulian.dto.CardPromotionSubDto;
import com.aiti.lulian.entity.LuLianEnterpriseHistory;
import com.aiti.lulian.service.ICardPromotionSubService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/card/promotion/sub")
public class CardPromotionSubController extends WebController {

    private final ICardPromotionSubService baseService;

    public CardPromotionSubController(ICardPromotionSubService baseService) {
        this.baseService = baseService;
    }

    @GetMapping("/page")
    public Message page(CardPromotionSubDto dto) {
        Page page = startPage(dto);
        return baseService.promotionSubList(page, dto);
    }

    @DeleteMapping("/delete")
    public Message delete(@RequestParam("baseId") String baseId) {
        return baseService.deletePromotionSub(baseId);
    }
}
